﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using System.Web.Mvc;
using CongressVote.Models;
using CongressVote.Controllers;

namespace CongressVote.Tests
{
    [TestFixture]
    class subjecttest
    {
        // test if the return value is of the expected type
        [Test]
        public void SubjectIndexReturnActionResult()
        {
            SubjectController myCon = new SubjectController();

            var myAction = myCon.Index();

            Assert.IsInstanceOf<ActionResult>(myAction);
        }

        //test if the model in the index action is list of subject object 

        [Test]
        public void Subject_Index_View_Contains_ListOfSubject_Model()
        {
            SubjectController mycon = new SubjectController();

            var myResultList = (List<Subject>)mycon.Index().Model;

            Assert.IsInstanceOf<List<Subject>>(myResultList);
        }

        
    }
}
